package com.dyz.leetcode._17_comprehensiveApplication;

public class _258_addDigits {
    public int addDigits(int num) {
        while (num>=10){
            num = totalNum(num);
        }
        return num;

    }

    private int totalNum(int num){
        int total = 0;
        while (num!=0){
            total+=num%10;
            num/=10;
        }
        return total;
    }
}
